<?php

namespace App\Http\Controllers\Modules;
use Illuminate\Http\Request;
use App\Http\Controllers\BaseApiController;
use App\Services\Modules\ModulesService;
class ModulesController extends BaseApiController{
    private $service;
    public function __construct(ModulesService $service){
        //继承基类的构造方法
        parent::__construct();
        //依赖注入service
        $this->service=$service;
    }

    /**
     * 模块展示
     */
    public function sel(Request $request)
    {
        //验证是否为空
        $rule=[ 'modules_type' =>"required|integer|max:9999999999"];
        $this->validate($rule,$request);
        //接值
        $params=$request->all();
        //调用ModulesService服务sel方法
        return $this->service->sel($params['modules_type']);
    }
}